/********************************************************************************
 ***                                                                          *** 
 ********************************************************************************
 *                                                                              * 
 *           Prject Name : MEMORIA                                              * 
 *                                                                              * 
 *             File Name : mainwindow.h                                         * 
 *                                                                              * 
 *            Programmer : LBW                                                  * 
 *                                                                              * 
 *            Start Date : December 26, 2020                                    * 
 *                                                                              * 
 *           Last Update : December 26, 2020   [LBW]                            * 
 *                                                                              * 
 *------------------------------------------------------------------------------*
 * Functions:                                                                   * 
 *==============================================================================*/ 

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>

class QVBoxLayout;
class QHBoxLayout;
class QAction;
class QToolBar;
class CardList;
class QPushButton;
class QSlider;
class QLabel;
class MainWindow : public QWidget
{
	Q_OBJECT
public:
	MainWindow(QWidget *parent = 0);
private slots:
	void load();
	void newCardList();
	void showCardList();
	void lock(int runMode);
	void sliderValueChanged(int);
	void cardSumChanged(int,int);
	void nextButton_clicked();
	void previousButton_clicked();
private:
	void createActions();
	void createToolBar();
	void createButtons();

	void newConnection();

	QVBoxLayout *mainLayout = nullptr;	
	QHBoxLayout *buttonLayout = nullptr;

	QToolBar *toolBar;
	QAction *newAction;
	QAction *loadAction;
	QAction *testAction;
	QAction *editAction;
	QAction *insertAction;
	QAction *deleteAction;
	QAction *saveAction;
	
	CardList *cardList = nullptr;
	QPushButton *nextPage,*previousPage;
	QSlider *slider;
	QLabel *totalPageLabel,*pageLabel;

	int sliderValue = 0;
	int page=0,thisPage=0;
};

#endif
